<?php

namespace api\goods\controller;

use Aaa\goods\model\GameModel;

class AdminSellRecommendationController extends \Aaa\goods\controller\AdminSellRecommendationController {

    protected $baseField = [
        [
            'field' => 'id',
            'name' => 'ID',
        ],
        [
            'field' => 'game_id',
            'name' => '游戏',
            'type' => 'select',
            'optionsSource' => [
                'table' => 'game',
                'nameField' => 'name',
                'valueField' => 'id',
                'where' => [['level', '=', 1]],
            ],
        ],
        [
            'field' => 'image',
            'name' => '图片',
            'type' => 'image',
        ],
        [
            'field' => 'width',
            'name' => '宽度（rpx）',
        ],
        [
            'field' => 'height',
            'name' => '高度（rpx）',
        ],
        [
            'field' => 'remark',
            'name' => '备注',
        ],
        [
            'field' => 'list_order',
            'name' => '排序',
        ],
    ];

    protected function beforeIndex() {
        $this->actionField = ['id','game_id', 'image', 'width', 'height', 'remark', 'list_order',];
    }

    protected function beforeAdd() {
        $this->actionField = ['game_id','image', 'width', 'height', 'remark', 'list_order',];
    }

    protected function beforeEdit() {
        $this->actionField = ['game_id','image', 'width', 'height', 'remark', 'list_order',];
    }


}
